import request from '@/utils/request'

// 自己 --------------------------------
export const loginByPwd = data => request({
  url: '/loginByPwd',
  method: 'post',
  data
})

export const getUserInfoByToken = () => request({
  url: '/getUserInfoByToken',
  method: 'get'
})

export const resetMyPwd = data => request({
  url: '/resetMyPwd',
  method: 'patch',
  data: data || {}
})

export const updateMyInfo = data => request({
  url: '/updateMyInfo',
  method: 'patch',
  data: data || {}
})

export const getCosTempToken = () => request({
  url: '/getCosTempToken',
  method: 'get'
})

// 员工 -----------------------------------
export const addOneEmployee = data => request({
  url: '/addOneEmployee',
  method: 'put',
  data: data || {}
})

export const deleteOneEmployee = id => request({
  url: '/deleteOneEmployee/' + id,
  method: 'delete'
})

export const resetOneEmployeePwd = id => request({
  url: '/resetOneEmployeePwd/' + id,
  method: 'patch'
})

export const updateOneEmployee = data => request({
  url: '/updateOneEmployee',
  method: 'patch',
  data: data || {}
})
export const updateOneAdmin = data => request({
  url: '/updateOneAdmin',
  method: 'patch',
  data: data || {}
})

export const getOneEmployee = id => request({
  url: '/getOneEmployee/' + id,
  method: 'get'
})

export const getEmployeeList = data => request({
  url: '/getEmployeeList',
  method: 'post',
  data: data || {}
})

export const getAllEmployeeList = () => request({
  url: '/getAllEmployeeList',
  method: 'get'
})

